package chapter1.No1_5_sleep方法;

/**
 * *：sleep方法：暂停执行（时间过后继续执行）
 *
 * @author liujian
 * @version 2016/11/8 0008
 */
public class MySleepThread extends Thread {
    @Override
    public void run() {
        try {
            System.out.println("开始执行时间："+System.currentTimeMillis());
            Thread.sleep(2000);
            System.out.println("结束执行时间："+System.currentTimeMillis());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        MySleepThread sleepThread =  new MySleepThread();
        sleepThread.start();
    }
}
